<!-- 分销 - 佣金明细 -->
<template>
  <s-layout class="wallet-wrap" title="27分销">
    <view v-if="userList.length > 0">
      <view
        class="wallet-list ss-flex border-bottom"
        v-for="item in userList"
        :key="item.id"
      >
        <view class="list-content">
          <view class="title-box ss-flex ss-row-between ss-m-b-20">
            <text class="title ss-line-1">{{ item.userName }}</text>
            <view class="money">
            </view>
          </view>
          <view class="ss-flex ss-row-between ss-col-center">
            <text class="time" style="color: inherit;">金额: {{ (item.productAmount || 0) / 100}}</text>
          </view>
          <view class="ss-flex ss-row-between ss-col-center">
            <text class="time">
              加入时间: {{ sheep.$helper.timeFormat(item.createTime, 'yyyy-mm-dd hh:MM:ss') }}
            </text>
          </view>
        </view>
      </view>
    </view>
    <s-empty v-if="userList.total === 0" icon="/static/data-empty.png" text="暂无数据"></s-empty>
  </s-layout>
</template>

<script setup>
  import { ref } from 'vue';
  import { onLoad } from '@dcloudio/uni-app';
  import sheep from '@/sheep';
  import BrokerageApi from '@/sheep/api/trade/brokerage';

  const headerBg = sheep.$url.css('/static/img/shop/user/wallet_card_bg.png');

  let userList = ref([]);

  async function getLogList() {
    let { code, data } = await BrokerageApi.findCurrentTeamUser();
    if (code !== 0) {
      return;
    }
    console.log('==========', data)
    userList.value = data || [];
  }
  onLoad(async () => {
    getLogList();
  });
</script>

<style lang="scss" scoped>

  // tab
  .wallet-tab-card {
    .tab-item {
      height: 80rpx;
      position: relative;

      .tab-title {
        font-size: 30rpx;
      }

      .cur-tab-title {
        font-weight: $font-weight-bold;
      }

      .tab-line {
        width: 60rpx;
        height: 6rpx;
        border-radius: 6rpx;
        position: absolute;
        left: 50%;
        transform: translateX(-50%);
        bottom: 2rpx;
        background-color: var(--ui-BG-Main);
      }
    }
  }

  // 钱包记录
  .wallet-list {
    padding: 30rpx;
    background-color: #ffff;
    width:90%;
    margin-left: 5%;
    margin-bottom: 20px;
    border-radius: 4px;
    box-sizing: border-box;
    &:first-child{
      margin-top: 20px;
    }
    .head-img {
      width: 70rpx;
      height: 70rpx;
      border-radius: 50%;
      background: $gray-c;
    }

    .list-content {
      justify-content: space-between;
      align-items: flex-start;
      flex: 1;

      .title {
        font-size: 28rpx;
        color: $dark-3;
        width: 400rpx;
      }

      .time {
        color: $gray-c;
        font-size: 22rpx;
      }
    }

    .money {
      font-size: 28rpx;
      font-weight: bold;
      font-family: OPPOSANS;

      .add {
        color: var(--ui-BG-Main);
      }

      .minus {
        color: $dark-3;
      }
    }

    .confirm-btn {
      font-size: 22rpx;
      color: var(--ui-BG-Main);
      background: rgba(var(--ui-BG-Main-rgb), 0.1);
      padding: 4rpx 16rpx;
      margin: 0;
      line-height: 1.4;
      border-radius: 20rpx;
      border: 1px solid var(--ui-BG-Main);
    }
  }

  .model-title {
    font-size: 36rpx;
    font-weight: bold;
    color: #333333;
  }

  .model-subtitle {
    font-size: 26rpx;
    color: #c2c7cf;
  }

  .model-btn {
    width: 100%;
    height: 80rpx;
    border-radius: 40rpx;
    font-size: 28rpx;
    font-weight: 500;
    color: #ffffff;
    line-height: normal;
  }

  .input-box {
    height: 100rpx;

    .unit {
      font-size: 48rpx;
      color: #333;
      font-weight: 500;
      line-height: normal;
    }

    .uni-easyinput__placeholder-class {
      font-size: 30rpx;
      height: 40rpx;
      line-height: normal;
    }
  }

  .status {
    font-size: 22rpx;
    &.status-0 {
      color: #ff9900;
    }
    &.status-1 {
      color: #19be6b;
    }
    &.status-2 {
      color: #fa3534;
    }
  }
</style>
